﻿namespace DHJ.Cost.Tasks
{
    /// <summary>
    /// Extension methods for <see cref="BatchIdentifier"/> and <see cref="IBatchIdentifier"/>.
    /// </summary>
    public static class BatchIdentifierExtensions
    {
        /// <summary>
        /// Creates a new <see cref="BatchIdentifier"/> object from any object implements <see cref="IBatchIdentifier"/>.
        /// </summary>
        /// <param name="batchIdentifier">Batch identifier.</param>
        public static BatchIdentifier ToBatchIdentifier(this IBatchIdentifier batchIdentifier)
        {
            return new BatchIdentifier(batchIdentifier.BatchId, batchIdentifier.Quantity);
        }
    }
}